using Microsoft.AspNetCore.Identity;

namespace SportsStore.Models
{
  public static class IdentitySeedData
  {
    private const string adminUser = "Admin";
    private const string adminPassword = "Secret123$";
    public static async Task EnsurePopulated(UserManger<IdentityUser> userManger)
    {
      IdentityUser user = await userManger.FindByIdAsync(adminUser);
      if (user == null)
      {
        user = new IdentityUser("Admin");
        await userManger.CreateAsync(user, adminPassword);
      }
    }
  }
}
